/*****************colorpalette.js****************/
document.write("<div id='_colorpalette' style='position: absolute; z-index: 9998; width: 215; height: 174; display: none;border-left:2px solid #F3F3F3;border-top:2px solid #F3F3F3; border-bottom:2px solid #999999;border-right:2px solid #999999;'>"); 
var _palettecolor = '#000000'; 
var script_t = document.getElementsByTagName('script'); 
var js_url=''; 
for (var i=0; i<script_t.length; i++)
{ 
  if( -1 != script_t[i].src.indexOf("colorpad.js"))
  {
    js_url = script_t[i].src.replace(/colorpad.js/,'colorpad.html');
    break;
  } 
} 
document.write("<iframe name='_colorpaletteIframe' src='"+js_url+"' scrolling=no frameborder=0 width=215 height=174></iframe></div>");
var e_colorpalette = document.getElementById("_colorpalette"); 
function setcolorpaletteXY()
{ 
  var e = window.event.srcElement; 
  var l=e.offsetLeft; 
  var t=e.offsetTop;   
  while(e=e.offsetParent)
  { 
    l+=e.offsetLeft; 
    t+=e.offsetTop;  
  } 
  e_colorpalette.style.left = l-15; 
  e_colorpalette.style.top = t+18; 
} 
function hiddencolorpalette(){e_colorpalette.style.display = "none";}; 
function showcolorpalette(){e_colorpalette.style.display = "block";setcolorpaletteXY();}; 
var colorpaletteiTime;
function setColorPalette(color)
{ 
  _palettecolor = color; 
} 
function getColorByPalette()
{ 
  return _palettecolor; 
} 

var dEL; 
function SelectColor(obj)
{ 
 // dEL = document.getElementById(obj); 
 dEL = obj;
  setColorPalette(dEL.value);
  showcolorpalette(); 
} 
function selectColorPalette(color)
{ 
  if (color)
  { 
    dEL.value=color; 
    dEL.style.backgroundColor=color; 
    setColorPalette(color);  
    }else{ 
    dEL.value=''; 
    dEL.style.backgroundColor=''; 
  } 
  hiddencolorpalette(); 
} 

